/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.cib.fintech.entrustedinvestment.biz.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author zhangqingkun
* @date 2020-10-16
**/
@Entity
@Data
@Table(name="fpss_prod_info")
public class ProdInfo implements Serializable {

    @Column(name = "fpss_prod_info")
    @ApiModelProperty(value = "表名")
    private String fpssProdInfo;

    @Id
    @Column(name = "prod_code")
    @ApiModelProperty(value = "产品代码（SAM推送）产品代码")
    private String prodCode;

    @Column(name = "prod_name")
    @ApiModelProperty(value = "产品名称（SAM推送）产品名称")
    private String prodName;

    @Column(name = "prod_name_abb")
    @ApiModelProperty(value = "产品简称（SAM推送）产品简称")
    private String prodNameAbb;

    @Column(name = "create_area")
    @ApiModelProperty(value = "产品创建地区（SAM推送）产品创建地区")
    private String createArea;

    @Column(name = "create_orgno")
    @ApiModelProperty(value = "产品创建机构（SAM推送）产品创建机构")
    private String createOrgno;

    @Column(name = "prod_base")
    @ApiModelProperty(value = "产品模型（SAM推送）")
    private String prodBase;

    @Column(name = "sales_cur")
    @ApiModelProperty(value = "销售币种（SAM推送）01.人民币、11.欧元、12.英镑、13.港币、14.美元、15.瑞士法郎、21.瑞典克朗、22.丹麦克朗、23.挪威克朗、27日元、28.加拿大元、29.澳大利亚元、32.马来西亚林吉特、38.荷兰盾、43.新家坡元、81.澳门元、84.泰国株、87.新西兰元、88.新台币")
    private String salesCur;

    @Column(name = "prod_risk_level")
    @ApiModelProperty(value = "产品风险等级（SAM推送）1.基本无风险、2.低风险、3.较低风险、4.中等风险、5.较高风险、6.高风险")
    private String prodRiskLevel;

    @Column(name = "subs_begin_date")
    @ApiModelProperty(value = "认购起始日（SAM推送）认购起始日")
    private String subsBeginDate;

    @Column(name = "subs_end_date")
    @ApiModelProperty(value = "认购结束日（SAM推送）认购结束日")
    private String subsEndDate;

    @Column(name = "establish_date")
    @ApiModelProperty(value = "认购归集日（SAM推送）认购归集日")
    private String establishDate;

    @Column(name = "value_date")
    @ApiModelProperty(value = "起息日（SAM推送）起息日")
    private String valueDate;

    @Column(name = "end_date")
    @ApiModelProperty(value = "到期日（SAM推送）到期日")
    private String endDate;

    @Column(name = "pay_date")
    @ApiModelProperty(value = "到期兑付日（SAM推送）到期兑付日")
    private String payDate;

    @Column(name = "trans_close_time")
    @ApiModelProperty(value = "日切时间")
    private String transCloseTime;

    @Column(name = "subs_n")
    @ApiModelProperty(value = "申购确认时效（SAM推送）申购确认时效（天）")
    private String subsN;

    @Column(name = "redeem_n")
    @ApiModelProperty(value = "赎回确认时效（SAM推送）赎回确认时效（天）")
    private String redeemN;

    @Column(name = "allow_sales_channel")
    @ApiModelProperty(value = "允许销售的渠道（SAM推送）允许销售的渠道（101.柜面、204网银、205.电话银行、206.金融自助通、208.手机银行、904.银银平台）")
    private String allowSalesChannel;

    @Column(name = "allow_cust_type")
    @ApiModelProperty(value = "允许的销售对象（SAM推送）允许的销售对象（1.普通：2.高净值：3.私行：4.企业：5.同业（复选逗号隔开，例如“，1,2，”））")
    private String allowCustType;

    @Column(name = "allow_card_type")
    @ApiModelProperty(value = "允许销售的卡种允许销售的卡种（89-安愉卡，91-菁资卡）")
    private String allowCardType;

    @Column(name = "start_age")
    @ApiModelProperty(value = "允许销售年龄上限")
    private String startAge;

    @Column(name = "end_age")
    @ApiModelProperty(value = "允许销售年龄下限")
    private String endAge;

    @Column(name = "allow_custom_type")
    @ApiModelProperty(value = "允许销售的客户层级（SAM推送）允许销售的客户层级（96.核心客户，97.黄金客户，98.白金客户，99.黑金客户，95.钻石客户，00.普通客户，（复选逗号隔开，例如“，1,2，”））")
    private String allowCustomType;

    @Column(name = "is_raise_fail")
    @ApiModelProperty(value = "是否募集失败是否募集失败（0.正常、1.募集失败）")
    private String isRaiseFail;

    @Column(name = "prod_status")
    @ApiModelProperty(value = "产品状态，产品状态（0.发行前、1.发行2.募集失败、3.成立、4.到期、5.到期兑付）")
    private String prodStatus;

    @Column(name = "sales_status")
    @ApiModelProperty(value = "销售状态（0-不可销售，1.正常销售）默认给 1，暂时不使用，预留字段")
    private String salesStatus;

    @Column(name = "income_vary_type")
    @ApiModelProperty(value = "收益浮动方式（SAM推送）收益浮动方式（0.固定、1.浮动2.变动））")
    private String incomeVaryType;

    @Column(name = "capital_flag")
    @ApiModelProperty(value = "是否保本（SAM推送）是否保本（0。否，1.是）")
    private String capitalFlag;

    @Column(name = "stop_busi_code")
    @ApiModelProperty(value = "暂停交易业务暂停交易业务（992违约退出9931申购撤单9926违约退出9925预约赎回9927实时赎回9920认购9921申购9932赎回撤单9922预约申购9924赎回9930认购撤单默认为空为全不允许 0000-为全部暂停 相当于暂停交易）")
    private String stopBusiCode;

    @Column(name = "year_days")
    @ApiModelProperty(value = "计息基础（SAM推送）360,360、365.365")
    private String yearDays;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    public void copy(ProdInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}